import { useState } from 'react'

export const useUIState = () => {
  // 视图模式状态
  const [viewMode, setViewMode] = useState('calendar') // 'table', 'calendar', 'holiday'
  // 添加工时Modal状态
  const [addModalVisible, setAddModalVisible] = useState(false)
  // 教程Modal状态
  const [tutorialVisible, setTutorialVisible] = useState(false)

  // 打开添加工时Modal
  const openAddModal = () => {
    setAddModalVisible(true)
  }

  // 关闭添加工时Modal
  const closeAddModal = () => {
    setAddModalVisible(false)
  }

  // 打开教程Modal
  const openTutorial = () => {
    setTutorialVisible(true)
  }

  // 关闭教程Modal
  const closeTutorial = () => {
    setTutorialVisible(false)
  }

  return {
    viewMode,
    setViewMode,
    addModalVisible,
    openAddModal,
    closeAddModal,
    tutorialVisible,
    openTutorial,
    closeTutorial,
  }
}
